package org.budo.mongo.jdbc.driver.statement;

import org.budo.jdbc.driver.statement.JdbcStatement;

/**
 * @author lmw
 */
public interface MongoStatement extends JdbcStatement {
    String PARAMETER_PREFIX = "${P[";

    int PARAMETER_PREFIX_LENGTH = PARAMETER_PREFIX.length();

    String PARAMETER_SUFFIX = "]}";

    /**
     * Date类型参数占位符前缀
     */
    String DATE_PREFIX = "Date[#";

    /**
     * Date类型参数占位符后缀
     */
    String DATE_SUFFIX = "]";

    /**
     * Date类型参数占位符位数
     */
    int DATE_DIGIT = 2;

    int DATE_FROM_INDEX = DATE_PREFIX.length();

    int DATE_TO_INDEX = DATE_FROM_INDEX + DATE_DIGIT;

    /**
     * Date类型参数最大个数
     */
    int DATE_COUNT_MAX = (int) Math.pow(10, DATE_DIGIT) - 1;

    /**
     * Date类型参数占位符格式
     */
    String DATE_INDEX_FORMAT = "%0" + DATE_DIGIT + "d";

    String AGGREGATE_PIPELINE = "AGGREGATE_PIPELINE";

    String WHERE = "WHERE";

    String INSERT_VALUES = "INSERT_VALUES";

    String UPDATE_VALUES = "UPDATE_VALUES";

    String SORT = "SORT";

    String PAGE = "PAGE";

    String SKIP = "SKIP";

    String LIMIT = "LIMIT";

    String _ID = "_id";
}